<?

require_once ("application.fieldset.inc");

global $_GLOBAL_DBH;
global $_OBJECT_IFACE_PANEL;

$fieldset_phases = new Fieldset (array (
	db_conn=>$_GLOBAL_DBH,
	relation=>"project_phases_view",
	relation_redirect=>"project_phase_phases",
	prefix=>"pmp_",
	fieldset=>array (
		array (name=>"id",label=>"ID",type=>"numeric",
				value=>$fieldset_phases->get_field ("phase_id_rkey")->get_variable ("value"),
				input=>"hidden",primary_key=>true),
		array (name=>"title",label=>"Title",type=>"alphanumeric",
				input=>"field"),
		array (name=>"details",label=>"Details",type=>"alphanumeric",
				input=>"textarea",rows=>5),
		array (name=>"date_begin",label=>"Date Begin",type=>"alphanumeric",
				input=>"date"),
		array (name=>"date_end",label=>"Date End",type=>"alphanumeric",
				input=>"date"),
		array (name=>"date_due",label=>"Date Due",type=>"alphanumeric",
				input=>"date"),
		array (name=>"cdate",label=>"Create Date",type=>"any",
				input=>"date_time",value=>_app_date_time ("pmp_cdate")),
	)
));

$fieldset_phases->parse ();

$return = "/fs_projects.php?fs_tab_phases=phases&project_id={$_REQUEST["project_id"]}&fs_tab=phases&fs_tab_option=fs_phases&fs_action=view&phase_id={$_REQUEST["phase_id"]}";

$fs_options = array ();

$image_options = array (size=>$_REQUEST["_img_size"]);

list ($fs_input, $fs_action, $store, $valid, $success) =

	_app_process_fieldset (array (
		fieldset=>$fieldset_phases,
		fs_options=>$fs_options,
		fs_primary_key=>"phase_id",
		fs_action=>($_REQUEST["fs_action_phases"] ?
				$_REQUEST["fs_action_phases"] :
				"view"),
		fs_action_field=>"fs_action_phases",
		fs_prefix=>"pmp_",
));

$_OBJECT_FIELDSET_CONTROL =_app_create_fieldset_object (array (
	fieldset_id=>"fs_project_phase_phases",
	db_conn=>$_GLOBAL_DBH,
	fieldset=>$fieldset_phases,
	fs_action=>$fs_action,
	fs_input=>$fs_input,
	fs_link=>"fs_projects.php?fs_tab=phases&project_id={$_REQUEST["project_id"]}&fs_tab_option=fs_phases&fs_action=view&fs_tab_phases=phases&fs_tab_option_phases=fs_phases&phase_id={$_REQUEST["phase_id"]}",
	fs_options=>$fs_options,
	fs_action_field=>"fs_action_phases",
	fs_prefix=>"pmp_",
));

$_OBJECT_IFACE_TABBING_PANEL->insert_container ($_OBJECT_FIELDSET_CONTROL);

?>
